
*EER Replciation Code

*Table 1, need migr_q5
*marriage:
tab migr_q5_1
*live near family:
tab migr_q5_2
*work:
tab migr_q5_5
*land:
tab migr_q5_9


*Table 2

reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border , cluster(sqkm)

reg help_collect_donations  exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border , cluster(sqkm)

reg neigh_let_use_well exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border , cluster(sqkm)


*Figure 1: see code below for Table B4


*Table 3

reg trust_pay_back co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
mal_border, cluster(sqkm)

reg help_collect_donations co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
mal_border, cluster(sqkm)

reg neigh_let_use_well co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
mal_border, cluster(sqkm)


*Table 4

reg trust_pay_back co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
if mal_border == 1, cluster(sqkm)

reg help_collect_donations co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
if mal_border == 1, cluster(sqkm)

reg neigh_let_use_well co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
if mal_border == 1, cluster(sqkm)


reg trust_pay_back co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
if mal_border == 0, cluster(sqkm)

reg help_collect_donations co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
if mal_border == 0, cluster(sqkm)

reg neigh_let_use_well co_loc_eth co_loc_non_eth non_loc_co_eth exp_co_wealth exp_co_age exp_co_gender ///
if mal_border == 0, cluster(sqkm)


*Figure 2: see code below for Table C1


*** Appendix ***

*Table A1

reg resp_migrant resp_maj_eth primary_schooling secondary_schooling post_secondary_schooling ///
resp_highinc resp_lowinc age resp_male ///
resp_lambya resp_lomwe resp_manganja resp_ndali resp_ngoni resp_nkhonde ///
resp_sena resp_senga resp_sukwa resp_tonga resp_tumbuka resp_yao resp_other ///
mal_border, cluster(sqkm)

reg resp_migrant resp_maj_eth primary_schooling secondary_schooling post_secondary_schooling ///
resp_highinc resp_lowinc age ///
resp_lambya resp_lomwe resp_manganja resp_ndali resp_ngoni resp_nkhonde ///
resp_sena resp_senga resp_sukwa resp_tonga resp_tumbuka resp_yao resp_other ///
mal_border if resp_male == 1, cluster(sqkm)

reg resp_migrant resp_maj_eth primary_schooling secondary_schooling post_secondary_schooling ///
resp_highinc resp_lowinc age resp_male ///
resp_lambya resp_lomwe resp_manganja resp_ndali resp_ngoni resp_nkhonde ///
resp_sena resp_senga resp_sukwa resp_tonga resp_tumbuka resp_yao resp_other ///
if mal_border == 1, cluster(sqkm)

reg resp_migrant resp_maj_eth primary_schooling secondary_schooling post_secondary_schooling ///
resp_highinc resp_lowinc age resp_male ///
resp_lambya resp_lomwe resp_manganja resp_ndali resp_ngoni resp_nkhonde ///
resp_sena resp_senga resp_sukwa resp_tonga resp_tumbuka resp_yao resp_other ///
if mal_border == 0, cluster(sqkm)


*Table A2

foreach i in exp_migrant exp_co_ethnic exp_highinc exp_lowinc exp_age50 exp_male {
	reg `i' age resp_male resp_migrant resp_highinc resp_lowinc resp_maj_eth mal_border, cluster(sqkm)
	est sto `i'
	}
*


*Table B1

*Trust
reg trust_pay_back exp_migrant##exp_foreign_mig exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border , cluster(sqkm)

 *Help
reg help_collect_donations  exp_migrant##exp_foreign_mig exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border , cluster(sqkm)

*Share Well outcome
reg neigh_let_use_well exp_migrant##exp_foreign_mig exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border , cluster(sqkm)
*


*Table B2

**pooled 
reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male exp_title ///
 mal_border , cluster(sqkm)

reg help_collect_donations  exp_migrant exp_co_ethnic exp_highinc exp_lowinc exp_age50 exp_male exp_title ///
 mal_border , cluster(sqkm)

 *Malawi
reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male exp_title ///
if mal_border == 1, cluster(sqkm)

reg help_collect_donations  exp_migrant exp_co_ethnic exp_highinc exp_lowinc exp_age50 exp_male exp_title ///
if mal_border == 1, cluster(sqkm)

*Zambia
reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male exp_title ///
if mal_border == 0, cluster(sqkm)

reg help_collect_donations  exp_migrant exp_co_ethnic exp_highinc exp_lowinc exp_age50 exp_male exp_title ///
if mal_border == 0, cluster(sqkm)



*Table B3

reg neigh_let_use_well exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male exp_title ///
, cluster(sqkm)

reg neigh_let_use_well exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male exp_title ///
if mal_border == 1, cluster(sqkm)

reg neigh_let_use_well exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male exp_title ///
if mal_border == 0, cluster(sqkm)


*Table B4

reg trust_pay_back co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender, cluster(sqkm)
 est sto co_trust_pooled
reg help_collect_donations co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender, cluster(sqkm)
 est sto co_help_pooled
reg neigh_let_use_well co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender, cluster(sqkm)
 est sto co_well_pooled

coefplot (co_trust_pooled, label("Trust") msymbol(circle) ) ///
         (co_help_pooled, label("Help") msymbol(diamond) ) ///
         (co_well_pooled, label("Well") msymbol(square) ), ///
         drop(_cons mal_border exp_title exp_age50 exp_male) ///
		 xline(0) omitted baselevels msymbol(d) ///
levels(95)  xtitle("{bf:Estimated Effects with Shared Identities}", size(small)) ///
         xscale(range(-.05 .05)) xlabel(-.05(.025).05) ///
         graphregion(color(white)) bgcolor(white) ///
         legend(rows(1) pos(6) size(small) region(lstyle(none))) ///
         ylab(, labsize(small) angle(horizontal) nogrid) ///
         xlab(, labsize(small)) 


*Table B5

reg trust_pay_back co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 1, cluster(sqkm)
reg help_collect_donations co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 1, cluster(sqkm)
reg neigh_let_use_well co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 1, cluster(sqkm)

reg trust_pay_back co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 0, cluster(sqkm)
reg help_collect_donations co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 0, cluster(sqkm)
reg neigh_let_use_well co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 0, cluster(sqkm)



*Table B6

reg trust_pay_back co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title mal_border, cluster(sqkm)
reg help_collect_donations co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title mal_border, cluster(sqkm)
  
reg trust_pay_back co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 1, cluster(sqkm)
reg help_collect_donations co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 1, cluster(sqkm)

reg trust_pay_back co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 0, cluster(sqkm)
reg help_collect_donations co_local exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 0, cluster(sqkm)


*Table B7

reg trust_pay_back exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender, cluster(sqkm)
reg help_collect_donations exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender, cluster(sqkm)

reg trust_pay_back exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 1, cluster(sqkm)
reg help_collect_donations exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 1, cluster(sqkm)

reg trust_pay_back exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 0, cluster(sqkm)
reg help_collect_donations exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 0, cluster(sqkm)


*Table B8

reg neigh_let_use_well exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender, cluster(sqkm)
reg neigh_let_use_well exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 1, cluster(sqkm)
reg neigh_let_use_well exp_co_migrant exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender if mal_border == 0, cluster(sqkm)


*Table B9

reg trust_pay_back exp_co_residency exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title mal_border, cluster(sqkm)
reg help_collect_donations exp_co_residency exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title mal_border, cluster(sqkm)
  
reg trust_pay_back exp_co_residency exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 1, cluster(sqkm)
reg help_collect_donations exp_co_residency exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 1, cluster(sqkm)

reg trust_pay_back exp_co_residency exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 0, cluster(sqkm)
reg help_collect_donations exp_co_residency exp_co_ethnic exp_co_wealth  exp_co_age exp_co_gender exp_co_title if mal_border == 0, cluster(sqkm)


*Table C1

reg neigh_follow_hmw exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
exp_title mal_border , cluster(sqkm)
est sto pool_hmw

reg neigh_follow_hmw exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title if mal_border == 1 , cluster(sqkm)
est sto mal_hmw

reg neigh_follow_hmw exp_migrant exp_co_ethnic  exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title if mal_border == 0 , cluster(sqkm)
est sto zam_hmw

coefplot (pool_hmw, label("Pooled") msymbol(circle) ) ///
         (mal_hmw, label("Malawi") msymbol(diamond) ) ///
         (zam_hmw, label("Zambia") msymbol(square) ), ///
         drop(_cons mal_border exp_title exp_age50 exp_male) ///
		   order(exp_migrant exp_highinc exp_lowinc exp_co_ethnic) ///
		 xline(0) omitted baselevels msymbol(d) ///
levels(95)  xtitle("{bf:Estimated Effects on Likelihood of Complying with VH Punishment}", size(small)) ///
         xscale(range(-.05 .05)) xlabel(-.05(.025).05) ///
         graphregion(color(white)) bgcolor(white) ///
         legend(rows(1) pos(6) size(small) region(lstyle(none))) ///
         ylab(, labsize(small) angle(horizontal) nogrid) ///
         xlab(, labsize(small)) 


*Table D1

reg trust_pay_back exp_migrant##c.prop_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border, cluster(sqkm)

reg help_collect_donations exp_migrant##c.prop_migrant exp_co_ethnic exp_highinc exp_lowinc exp_age50 exp_male ///
 exp_title mal_border, cluster(sqkm)

reg trust_pay_back exp_migrant##c.prop_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title  if mal_border == 1, cluster(sqkm)

reg help_collect_donations exp_migrant##c.prop_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title  if mal_border == 1, cluster(sqkm)

reg trust_pay_back exp_migrant##c.prop_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title  if mal_border == 0, cluster(sqkm)

reg help_collect_donations exp_migrant##c.prop_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title  if mal_border == 0, cluster(sqkm)


*Table E1

reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border prop_sk_pop_pat_now prop_sk_pop_mat_now, cluster(sqkm)

reg help_collect_donations  exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title mal_border prop_sk_pop_pat_now prop_sk_pop_mat_now, cluster(sqkm)

reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title prop_sk_pop_pat_now prop_sk_pop_mat_now  if mal_border == 1, cluster(sqkm)

reg help_collect_donations exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title prop_sk_pop_pat_now prop_sk_pop_mat_now  if mal_border == 1, cluster(sqkm)

reg trust_pay_back exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title prop_sk_pop_pat_now prop_sk_pop_mat_now  if mal_border == 0, cluster(sqkm)

reg help_collect_donations exp_migrant exp_co_ethnic exp_highinc exp_lowinc  exp_age50 exp_male ///
 exp_title prop_sk_pop_pat_now prop_sk_pop_mat_now  if mal_border == 0, cluster(sqkm)


*Table F1

*pooled
reg trust_pay_back co_gen_eth co_gen_non_eth non_gen_co_eth exp_co_wealth  exp_co_age co_local ///
mal_border, cluster(sqkm)

reg help_collect_donations co_gen_eth co_gen_non_eth non_gen_co_eth exp_co_wealth  exp_co_age co_local ///
mal_border, cluster(sqkm)

reg trust_pay_back co_gen_eth co_gen_non_eth non_gen_co_eth exp_co_wealth  exp_co_age co_local ///
if mal_border == 1, cluster(sqkm)

reg help_collect_donations co_gen_eth co_gen_non_eth non_gen_co_eth exp_co_wealth  exp_co_age co_local ///
if mal_border == 1, cluster(sqkm)

reg trust_pay_back co_gen_eth co_gen_non_eth non_gen_co_eth exp_co_wealth  exp_co_age co_local ///
if mal_border == 0, cluster(sqkm)

reg help_collect_donations co_gen_eth co_gen_non_eth non_gen_co_eth exp_co_wealth  exp_co_age co_local ///
if mal_border == 0, cluster(sqkm)


*Table F2

reg trust_pay_back co_class_eth co_class_non_eth non_class_co_eth exp_co_gender  exp_co_age co_local ///
mal_border, cluster(sqkm)

reg help_collect_donations co_class_eth co_class_non_eth non_class_co_eth exp_co_gender  exp_co_age co_local ///
mal_border, cluster(sqkm)

reg trust_pay_back co_class_eth co_class_non_eth non_class_co_eth exp_co_gender  exp_co_age co_local ///
if mal_border == 1, cluster(sqkm)

reg help_collect_donations co_class_eth co_class_non_eth non_class_co_eth exp_co_gender  exp_co_age co_local ///
if mal_border == 1, cluster(sqkm)

reg trust_pay_back co_class_eth co_class_non_eth non_class_co_eth exp_co_gender  exp_co_age co_local ///
if mal_border == 0, cluster(sqkm)

reg help_collect_donations co_class_eth co_class_non_eth non_class_co_eth exp_co_gender  exp_co_age co_local ///
if mal_border == 0, cluster(sqkm)





